Optimal. Leaf size=75 \[ -\frac {3 a \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac {b \cot (c+d x)}{d}+\frac {3 a \sec (c+d x)}{2 d}-\frac {a \csc ^2(c+d x) \sec (c+d x)}{2 d}+\frac {b \tan (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 75, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 7, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.259, Rules used = {2917, 2702,
294, 327, 213, 2700, 14} \begin {gather*} \frac {3 a \sec (c+d x)}{2 d}-\frac {3 a \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac {a \csc ^2(c+d x) \sec (c+d x)}{2 d}+\frac {b \tan (c+d x)}{d}-\frac {b \cot (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 14
Rule 213
Rule 294
Rule 327
Rule 2700
Rule 2702
Rule 2917
Rubi steps
\begin {align*} \int \csc ^3(c+d x) \sec ^2(c+d x) (a+b \sin (c+d x)) \, dx &=a \int \csc ^3(c+d x) \sec ^2(c+d x) \, dx+b \int \csc ^2(c+d x) \sec ^2(c+d x) \, dx\\ &=\frac {a \text {Subst}\left (\int \frac {x^4}{\left (-1+x^2\right )^2} \, dx,x,\sec (c+d x)\right )}{d}+\frac {b \text {Subst}\left (\int \frac {1+x^2}{x^2} \, dx,x,\tan (c+d x)\right )}{d}\\ &=-\frac {a \csc ^2(c+d x) \sec (c+d x)}{2 d}+\frac {(3 a) \text {Subst}\left (\int \frac {x^2}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{2 d}+\frac {b \text {Subst}\left (\int \left (1+\frac {1}{x^2}\right ) \, dx,x,\tan (c+d x)\right )}{d}\\ &=-\frac {b \cot (c+d x)}{d}+\frac {3 a \sec (c+d x)}{2 d}-\frac {a \csc ^2(c+d x) \sec (c+d x)}{2 d}+\frac {b \tan (c+d x)}{d}+\frac {(3 a) \text {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{2 d}\\ &=-\frac {3 a \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac {b \cot (c+d x)}{d}+\frac {3 a \sec (c+d x)}{2 d}-\frac {a \csc ^2(c+d x) \sec (c+d x)}{2 d}+\frac {b \tan (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(172\) vs. \(2(75)=150\).
time = 0.26, size = 172, normalized size = 2.29 \begin {gather*} -\frac {2 b \cot (2 (c+d x))}{d}-\frac {a \csc ^2\left (\frac {1}{2} (c+d x)\right )}{8 d}-\frac {3 a \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{2 d}+\frac {3 a \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{2 d}+\frac {a \sec ^2\left (\frac {1}{2} (c+d x)\right )}{8 d}+\frac {a \sin \left (\frac {1}{2} (c+d x)\right )}{d \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}-\frac {a \sin \left (\frac {1}{2} (c+d x)\right )}{d \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.18, size = 83, normalized size = 1.11
method | result | size |
derivativedivides | \(\frac {a \left (-\frac {1}{2 \sin \left (d x +c \right )^{2} \cos \left (d x +c \right )}+\frac {3}{2 \cos \left (d x +c \right )}+\frac {3 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )+b \left (\frac {1}{\sin \left (d x +c \right ) \cos \left (d x +c \right )}-2 \cot \left (d x +c \right )\right )}{d}\) | \(83\) |
default | \(\frac {a \left (-\frac {1}{2 \sin \left (d x +c \right )^{2} \cos \left (d x +c \right )}+\frac {3}{2 \cos \left (d x +c \right )}+\frac {3 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )+b \left (\frac {1}{\sin \left (d x +c \right ) \cos \left (d x +c \right )}-2 \cot \left (d x +c \right )\right )}{d}\) | \(83\) |
risch | \(-\frac {i \left (3 i a \,{\mathrm e}^{5 i \left (d x +c \right )}-2 i a \,{\mathrm e}^{3 i \left (d x +c \right )}+3 i a \,{\mathrm e}^{i \left (d x +c \right )}+4 b \,{\mathrm e}^{2 i \left (d x +c \right )}-4 b \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2} \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{2 d}+\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{2 d}\) | \(125\) |
norman | \(\frac {\frac {a}{8 d}-\frac {9 a \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {a \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d}+\frac {b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 d}-\frac {5 b \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}-\frac {5 b \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}+\frac {b \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}-\frac {2 a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+\frac {3 a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}\) | \(184\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 84, normalized size = 1.12 \begin {gather*} \frac {a {\left (\frac {2 \, {\left (3 \, \cos \left (d x + c\right )^{2} - 2\right )}}{\cos \left (d x + c\right )^{3} - \cos \left (d x + c\right )} - 3 \, \log \left (\cos \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )} - 4 \, b {\left (\frac {1}{\tan \left (d x + c\right )} - \tan \left (d x + c\right )\right )}}{4 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.44, size = 128, normalized size = 1.71 \begin {gather*} \frac {6 \, a \cos \left (d x + c\right )^{2} - 3 \, {\left (a \cos \left (d x + c\right )^{3} - a \cos \left (d x + c\right )\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 3 \, {\left (a \cos \left (d x + c\right )^{3} - a \cos \left (d x + c\right )\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 4 \, {\left (2 \, b \cos \left (d x + c\right )^{2} - b\right )} \sin \left (d x + c\right ) - 4 \, a}{4 \, {\left (d \cos \left (d x + c\right )^{3} - d \cos \left (d x + c\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: SystemError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.47, size = 116, normalized size = 1.55 \begin {gather*} \frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 12 \, a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 4 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {16 \, {\left (b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1} - \frac {18 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 4 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2}}}{8 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 11.93, size = 127, normalized size = 1.69 \begin {gather*} \frac {b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d}-\frac {-10\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-\frac {17\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{2}+2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {a}{2}}{d\,\left (4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\right )}+\frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}+\frac {3\,a\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{2\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________